﻿using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using XiAnAirport.BUS.RocketMQ;

namespace XiAnAirport.BUS.Mqtt
{
    public static class MqttAppExtensions
    {

        public static IApplicationBuilder UseMqttClient(this IApplicationBuilder app)
        {
            var server = app.ApplicationServices.GetRequiredService<FXMqttClient>();

            return app;
        }

        public static IApplicationBuilder UseMqttServer(this IApplicationBuilder app)
        {
            var server = app.ApplicationServices.GetRequiredService<FXMqttServer>();

            return app;
        }

        public static IApplicationBuilder UseRocketMQConsume(this IApplicationBuilder app)
        {
            var server = app.ApplicationServices.GetRequiredService<FXMQClient>();

            return app;
        }

        public static IApplicationBuilder UseMqttShareClient(this IApplicationBuilder app)
        {
            var server = app.ApplicationServices.GetRequiredService<FXMqttShareClient>();

            return app;
        }
    }
}
